package sjtu.rfid.rri.services.io;

import java.io.IOException;

/**
 * This interface defines the Server Connection, which servers as a server and 
 * wait for clients to connect.
 * Usually, the server connection is the socket server.
 * @author Jinghao
 *
 */
public interface ServerConnection {
	/**
	 * accept client's connection
	 * blocks until one client connects
	 * @return a Connection with the client
	 * @throws IOException
	 */
	public Connection acceptAndConnect() throws IOException;

	/**
	 * close all opened connections connected with clients.
	 * @throws IOException
	 */
	public void closeOpenConnection() throws IOException;
	
	/**
	 * close the server connection
	 * @throws IOException
	 */
	public void close() throws IOException;
}
